package com.dingup.api.model.classInfo;

import com.dingup.api.enums.ClassUserTypeEnum;

import java.util.Date;

public class ClassUserInfo implements Cloneable{
    private Integer id;

    private Integer classId;

    private ClassUserTypeEnum type;

    private String createUserId;

    private Date createTime;

    private String userId;

    private String userName;

    private String typeString;

    public ClassUserInfo(String userId) {
        this.userId = userId;
    }

    public ClassUserInfo() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public ClassUserTypeEnum getType() {
        return type;
    }

    public void setType(ClassUserTypeEnum type) {
        this.type = type;
    }

    public String getTypeString() {
        return typeString;
    }

    public void setTypeString(String typeString) {
        this.typeString = typeString;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId == null ? null : createUserId.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }


    /**
     * 实体克隆
     * @return
     * @throws CloneNotSupportedException
     */
    public ClassUserInfo clone() throws CloneNotSupportedException{
        ClassUserInfo ts = (ClassUserInfo) super.clone();
        return ts;
    }

    @Override
    public boolean equals(Object o) {
        ClassUserInfo that = (ClassUserInfo)o;
        return userId.equals(that.getUserId()) && classId.equals(that.getClassId()) && type.equals(that.getType());
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (classId != null ? classId.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        return result;
    }
}